package com.bonc.ioc.controller;

import com.bonc.ioc.common.util.AppReply;
import com.bonc.ioc.service.HomePageService;
import com.bonc.ioc.vo.DaassetsVo;
import com.bonc.ioc.vo.TopicVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author liuyang
 * @creats 2021-04-09-11:00
 */
@RestController
@RequestMapping("/homePage")
@Slf4j
public class HomePageController {

    @Autowired
    HomePageService homePageService;
    /**
     * 累计访问人数
     * @return com.bonc.ioc.common.util.AppReply
     */
    @GetMapping("/headerInformationNum")
    public AppReply headerInformationNum(){
        return AppReply.success(homePageService.getVisitNum());
    }
    /**
     * 专题
     * @return com.bonc.ioc.common.util.AppReply
     */
    @GetMapping("/getSpecial")
    public AppReply getSpecial(@RequestParam(defaultValue = "4") String pageSize, @RequestParam(defaultValue = "0")String pageNum){
        return AppReply.success(homePageService.getSpecial(pageSize,pageNum));
    }
}
